﻿<phoneNavigation:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phoneNavigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Phone7ActionPack_Behaviors="clr-namespace:Phone7ActionPack.Behaviors;assembly=Phone7ActionPack" 
    x:Class="P7AP.Samples.OrientationChanged.MainPage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}" d:Orientation="Portrait">

	<i:Interaction.Behaviors>
		<Phone7ActionPack_Behaviors:OrentationChangedGoToStateBehavior LandscapeLeftStateName="LeftState" LandscapeRightStateName="RightState" UseTransitions="True" PortraitStateName="NormalState" />
	</i:Interaction.Behaviors>

    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}">
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="RotationStates">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:0.4"/>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="NormalState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="-13" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="RightState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="331" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="LeftState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="-363" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="6" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="UpsidedownState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="-362" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="-105" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <Grid.RowDefinitions>
        	<RowDefinition Height="Auto"/>
        	<RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitleGrid is the name of the application and page title-->
        <Grid x:Name="TitleGrid" Grid.Row="0">
            <TextBlock Text="MY APPLICATION" x:Name="textBlockPageTitle" Style="{StaticResource PhoneTextPageTitle1Style}"/>
            <TextBlock Text="page title" x:Name="textBlockListTitle" Style="{StaticResource PhoneTextPageTitle2Style}"/>
        </Grid>

        <!--ContentGrid is empty. Place new content here-->
        <Grid x:Name="ContentGrid" Grid.Row="1">
        	<Rectangle x:Name="rectangle" Fill="#FFF4F4F5" RadiusY="0" RadiusX="0" StrokeStartLineCap="Flat" StrokeEndLineCap="Flat" Stroke="Black" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter" Width="100" Height="100" Margin="204,0,176,8" VerticalAlignment="Bottom" d:LayoutOverrides="Height" RenderTransformOrigin="0.5,0.5">
        		<Rectangle.RenderTransform>
        			<CompositeTransform/>
        		</Rectangle.RenderTransform>
        	</Rectangle>
        </Grid>
    </Grid>
    
</phoneNavigation:PhoneApplicationPage>